package com.ciei.dpagm.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ciei.dpagm.common.service.BaseService;
import com.ciei.dpagm.entity.ChipControlModeInterfaceType;
import com.ciei.dpagm.mapper.ChipControlModeInterfaceTypeMapper;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author wangyan
 * @date 2023/05/08
 */
@Service
public class ChipControlModeInterfaceTypeService extends BaseService<ChipControlModeInterfaceTypeMapper, ChipControlModeInterfaceType> {

    /**
     * 获取列表
     * @param chipControlModeInterfaceIdList
     * @return
     */
    public List<ChipControlModeInterfaceType> getList(List<Integer> chipControlModeInterfaceIdList){
        if(chipControlModeInterfaceIdList.isEmpty()){
            return new ArrayList<>();
        }
        LambdaQueryWrapper<ChipControlModeInterfaceType> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.in(ChipControlModeInterfaceType::getControlModeInterfaceId,chipControlModeInterfaceIdList);
        List<ChipControlModeInterfaceType> chipControlModeInterfaceTypeList = list(lambdaQueryWrapper);
        return chipControlModeInterfaceTypeList;
    }

}
